﻿using System;
using System.Collections.Generic;
using System.Text;

namespace 作业
{
    class student
    {
        string name;
        int age;
        string degree;

        public string Name { get => name; set => name = value; }
        public int Age { get => age; set => age = value; }
        public string Degree { get => degree; set => degree = value; }

        public student(string name,int age,string degree)
        {
            this.name = name;
            this.age = age;
            this.degree = degree;
        }
    }
    class Undergraduate : student
    {
        string spec;
        public string Spec { get => spec; set => spec = value; }
        public Undergraduate(string name ,int age , string degree,string spec):base(name,age,degree)
        {
            this.spec = spec;
        }

        public void print()
        {
            Console.WriteLine("姓名{0}  年龄{1}  学位{2}  专业  {3}",Name,Age,Degree,Spec);
        }
    }
    class Graduate : student
    {
        string drec;
        public string Drec { get => drec; set => drec = value; }

        public Graduate(string name,int age,string degree,string drec):base(name,age,degree)
        {
            this.Drec = drec;
        }
        public void print()
        {
            Console.WriteLine("姓名{0}  年龄{1}  学位{2}  研究方向  {3}", Name, Age, Degree, Drec);
        }
    }
}
